#include "stdafx.h"
#include "TestConfigrations.h"
#include "Configrations.h"
#include "Configration.h"

using namespace PDMS::PDMSFrame;

CPPUNIT_TEST_SUITE_REGISTRATION( TestConfigrations );


TestConfigrations::TestConfigrations()
{
}


TestConfigrations::~TestConfigrations()
{
}

void TestConfigrations::TestConstructor()
{
	Configrations configs;

	CPPUNIT_ASSERT( configs.GetElementCount() == 0 );
}

void TestConfigrations::TestAddConfigration()
{
	UESoft::ErrorStatus es = UESoft::eOk;
	Configrations configs;
	Configration* pConfig = new Configration;
	pConfig->Name( _T("Test") );

	es = configs.AddConfigration( pConfig );
	CPPUNIT_ASSERT( configs.GetElementCount() == 1 );
	CPPUNIT_ASSERT( es == UESoft::eOk );

	es = configs.AddConfigration( pConfig );
	CPPUNIT_ASSERT( configs.GetElementCount() == 1 );
	CPPUNIT_ASSERT( es == UESoft::eKeyIsExist );
	
}